package io.github.uicdb.gravity_generator;

import io.github.uicdb.gravity_generator.GGUtils;
import io.github.uicdb.gravity_generator.block.BEGravityGenerator;
import io.github.uicdb.gravity_generator.block.BlockGravityGenerator;
import io.github.uicdb.gravity_generator.block.HarmlessBEGravityGenerator;
import io.github.uicdb.gravity_generator.block.HarmlessBlockGravityGenerator;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import org.jetbrains.annotations.NotNull;

public class GGRegistries {
    public static final CreativeModeTab GG_TAB=new CreativeModeTab(GGUtils.MODID) {
        @NotNull
        @Override
        public ItemStack makeIcon() {
            return new ItemStack(GRAVITY_GENERATOR_ITEM.get());
        }
    };
    public static final DeferredRegister<Block> BLOCKS=DeferredRegister.create(ForgeRegistries.BLOCKS, GGUtils.MODID);
    public static final RegistryObject<BlockGravityGenerator> GRAVITY_GENERATOR=BLOCKS.register("gravity_generator",()->new BlockGravityGenerator(BlockBehaviour.Properties.copy(Blocks.IRON_BLOCK).noOcclusion()));
    public static final RegistryObject<HarmlessBlockGravityGenerator> HARMLESS_GRAVITY_GENERATOR=BLOCKS.register("harmless_gravity_generator",()->new HarmlessBlockGravityGenerator(BlockBehaviour.Properties.copy(Blocks.DIAMOND_BLOCK).noOcclusion()));
    public static final DeferredRegister<Item> ITEMS=DeferredRegister.create(ForgeRegistries.ITEMS, GGUtils.MODID);
    public static final RegistryObject<BlockItem> GRAVITY_GENERATOR_ITEM=ITEMS.register("gravity_generator",()->new BlockItem(GRAVITY_GENERATOR.get(),new Item.Properties().tab(GG_TAB)));
    public static final RegistryObject<BlockItem> HARMLESS_GRAVITY_GENERATOR_ITEM=ITEMS.register("harmless_gravity_generator",()->new BlockItem(HARMLESS_GRAVITY_GENERATOR.get(),new Item.Properties().tab(GG_TAB)));
    public static final DeferredRegister<BlockEntityType<?>> BLOCK_ENTITY_TYPES=DeferredRegister.create(ForgeRegistries.BLOCK_ENTITIES, GGUtils.MODID);
    public static final RegistryObject<BlockEntityType<BEGravityGenerator>> GRAVITY_GENERATOR_TYPE=BLOCK_ENTITY_TYPES.register("gravity_generator_type",()->BlockEntityType.Builder.of(BEGravityGenerator::new, GRAVITY_GENERATOR.get()).build(null));
    public static final RegistryObject<BlockEntityType<HarmlessBEGravityGenerator>> HARMLESS_GRAVITY_GENERATOR_TYPE=BLOCK_ENTITY_TYPES.register("harmless_gravity_generator_type",()->BlockEntityType.Builder.of(HarmlessBEGravityGenerator::new, HARMLESS_GRAVITY_GENERATOR.get()).build(null));
}
